home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
zmenu_v2.zip
/
ZMENU.T
< prev
next >
Wrap
Text File
|
1990-04-25
|
32KB
|
814 lines
: ZMENU.T ZCOMM Version 2 90-05-01
: previous verions V1 V1A superseded
:: modem assumed to support full Hayes set. Limited modem support.
: Author: Bruce E. Högman, 629 S. 24th St., Arlington VA 22202-2525
: Phone: (703) 685-4926 (home) (703) 644-5200x6470 (work)
: FAX: (703) 685-0478 (home)
: Users are encouraged to contact the author with suggestions.
: See ZMENU.DOC
::
::=== Symbols used within zmenu.t
::
:: Labels contained in zmenu.t
::
:: setup initializes menu system. Called by ZCOMM at start,
:: if phones set to zmenu.t
:: setup processing also results in a zmnuparm.t
:: script which is used for all future startups.
:: to alter zmnuparm.ini, edit it, then del zmnuparm.t
:: and call setup.
::
:: bbs Direct entry into BBS menu (only after setup)
:: boards Direct entry into BBS menu (only after setup)
::
:: displayreset resets display to value in zmnuparm.ini,
:: cancels keyboard customization using 'mk' cmd
::
:: hangup puts modem into command mode and issues ATH
::
:: inigrab grabs parameters from zmnuparm.ini file
:: (like win.ini for windows, you know)
::
:: offyam what do you want to do upon "off" command?
::
:: online call online when you tromp on script or
:: exit to command mode. this is easy return to
:: term mode.
::
:: your_name your system names to call. make a label for the
:: system name, then: your_name goback rmtcall.
:: ZCOMM nicely sets string 'remote' to your_name,
:: and the 'rmtcall' script carries on from there.
:: You will, however, also need an entry in zmnulgn.T
::
:: zmenu*** sub-menu scripts
::
:: Main entry point for "call zmenu"
:: string phones is used by ZCOMM as where to go to find scripts
:: Symbols used in ZCOMM version:
::
:: YAM-type ZCOMM-type
:: menumode fa12 str 1 ` \x60 on/off z0
:: menuinit fa12 str 2 y/n z1
:: menupage fa12 str 3 e/1/2/3/4... z2
:: timezone fa12 str 4 EST/EDT/CST/CDT... z3
::
:: menufone fa11 whole variable %lib/zmnufon%page
::
:: modemspeed fa10 whole variable
::
:: menutitle fa9 whole variable
::
:: modeminit fa8 whole variable
::
:: colordisplay fa7 str 1 ` y/n
:: colornormal fa7 str 2 \E[0;33;1m yellow
:: colorhigh fa7 str 3 \E[0;31;1m red
::
:: menumsg fa6 whole variable
:: emulate fa5 whole variable
:: mndispl1 fa4 whole variable
:: mndispl2 fa3 whole variable
:: fa2
:: termmode fa1 whole variable
::
:: (script stuff)
:: myfirstname fc11 whole variable
:: mylastname fc12 whole variable
:: mycity fc10 whole variable
:: mystate fc9 whole variable
:: mypassword fc8 whole variable (set by findq processing)
:: rmtcript fc7 whole variable (set by findq processing)
:: rmttitle fc6 whole variable (set by findq processing)
:: myconnect fc5 whole
:: TSOuserid fc4 whole
:: TSOpasswd fc3 whole
:: rmtmsg fc2 whole message text
:: msglevel fc1 whole numeric range 0-5 0 is silent
:: menuhname fs12 whole
:: menuhscr fs11 whole
::
::=== zmenu entry point
:: If you call zmenu, then I assume you want to use menu system.
zmenu: set phones zmenu.t
::
:: if menu system is not initialized, go do setup
if !%fa12 goto setup
::
:: display zmenu screen
type zmenu.scr
::
:: if user has defined a menu title line, display it, centered.
set ifs "`";split fa7
if %fa9 setn n1 79-%fa9/2
if %fa9 lput "\E[s\E[1;%n1\&H%z1 %fa9 \E[u%z2"
::
:: show the last command entered
set ifs "`";split fa7
if !%fa6 set fa6 "None"
lput "\E[2A\E[17C\E[35;1mLAST: %fa6\&\E[u%z2"
::
::=== accept the one-character menu option that says what to do
::
set ifs "`";split fa7
set s0 "";acceptl1 s0 "\E[3A\E[13C%z1\&_\E[1D\E[s%z2"
:: Here's a branch table to go places based on user keyed input:
if is0,b goto zmnub
if is0,c goto zmnuc
if is0,d goto zmnud
if is0,e goto zmnue
if is0,g goto zmnug
if is0,h goto zmnuh
if is0,i cls;goto setup
if is0,k goto zmnuk
if is0,m goto zmnum
if is0,o goto zmnuo
if is0,p goto zmnup
if is0,q goto zmnuq
if is0,x goto zmnux
if is0,s goto zmnus
if is0,t goto zmnut
set fa6 "not recognized"
if afc1<4 goback zmenu
lput "\E[10;1H\E[J\E[1B\E[80D\E[0;36;1mOption %s0 not recognized"
lput "\E[1B\E[80DOn this panel, you are restricted to entering"
lput "\E[1B\E[80Djust those letters listed with the menu options."
lput "\E[1B\E[80DI will display help information now."
set s1 "-any key to continue-";setn n1 79-%s1/2
acceptl1 s0 "\E[1B\E[80D\E[%n1\&C%s1"
set fs12 "";goto zmnuhm
::
::=== Setup is called by ZCOMM on entry or on first call to zmenu.t
::
setup:
:: If the script file exists, then use it for faster initialization
if !fzmnuparm.t goto setupcold
setuphot:
sets s0 " source %drive:%home/zmnuparm.t";gosub execute
userexit:
if f%lib/zmnuuser.t source %lib/zmnuuser.t
set fa6 "Menu system Initialized"
:: menumode fa12 str 1 ` on/off z0
:: menuinit fa12 str 2 y/n z1
:: menupage fa12 str 3 e/1/2/3/4... z2
:: timezone fa12 str 4 EST/EDT/CST/CDT... z3
setc ifs "`";split fa12;set z1 y
setc fa12 "%z0\&`\&%z1\&`\&%z2\&`\&%z3\&`"
if iz0,off return
goback zmenu
::
:: displayreset is used to return to a known mode after doing
:: strange things in remote logon scripts, maybe (for IBM with
:: Renex, in particular) Among other things, it cancels keyboard
:: mapping which may be used with strange protocol converters.
displayreset:
if %fa5 sets s0 "%fa5";gosub execute
if %fa4 sets s0 "%fa4";gosub execute
if %fa3 sets s0 "%fa3";gosub execute
mk
return
:: This little routine simply waits for a number of intervals based
:: on relative expertise as set in msglevel (fc1).
:: This assumes that experts can read faster or don't need help at all.
dwell:
setn n2 fc1*8;setn n1 0
dwellloop:
setn n1 n1+8;if an1>n2 return
sleep 8;goback dwellloop
::
:: execute gosub supports use of temp file to issue commands
:: on input: s0 has command to execute
:: This corresponds to the Pro-YAM "obey" command
execute:
kill;ki;sets s1 "%dircx";sets dircx "%drive:%home";del zmnumain.tmp
create zmnumain.tmp;echof " %s0";close;source zmnumain.tmp
sets dircx "%s1";return
:: This routine resets term mode to use-specified values
termmode:
sets s0 "%dircx";sets dircx "%drive:%home";del zmnumain.tmp
create zmnumain.tmp;echof " ena %fa1";close;source zmnumain.tmp
sets dircx "%s0";return
::
:: This routine is meant to force a hangup. It usually works.
hangup: bye;o;pat
mk;dis -t;pat 0 "OK";sets s0 "speed %fa10";gosub execute
put "+++\r";sleep 5;put "ATH\r"
wait -f1
if !0 goto hangup
hangupx: put "\r";pat;gosub displayreset
lput "\E[80D\E[K\E[1A\E[K\E[1A\E[K"
if afc1>0 if !jfa6,HUNG sets fa6 "%fa6 HUNG UP"
echo " MODEM HUNG UP ";if afc1>0 sleep 5
set ifs "`";split fa12;if i%z0,off return
if jfa6,BBS goto zmnub
goback zmenu
::
:: inigrab input: s0 set to string to find
:: and zmnuparm.ini contains init values: keyword value value
:: ZCOMM version of inigrab
inigra